<template>
  <div id="app">
    <div v-if="$route.meta.isShow" class="foot_mue">
      <router-link  v-for="(val,index) in arr" :to="val.path" >
        <span :class=" val.cont"></span><br>
        {{val.name}}
      </router-link>
    </div>
    <router-view/>
  </div>
</template>
<script>
    import 'jquery/dist/jquery.js';
export default {
    data(){
        return {
            arr:[
                {path: '/Home', name: '首页',cont:'iconfont icon-home'},
                {path: '/Cheap2', name: '今日特惠',cont:'iconfont icon-tejia'},
                {path: '/Car', name: '购物车',cont:'iconfont icon-gouwuche'},
                {path: '/My', name: '我的',cont:'iconfont icon-weibiaoti2fuzhi12'}
            ]
           }
        },
    methods:{
    },
    mounted(){  //生命周期中的挂载函数
      if(localStorage.getItem('shopCar')==null){
        this.$store.state.shopCar = [];
      }else{
        this.$store.state.shopCar = JSON.parse(localStorage.getItem('shopCar'));
      }
        // this.$axios('/api/datadeal').then((data)=>{
        //     console.log(data);
        // }).catch((err)=>{
        //     console.log(err);
        // })
    },
    update(){  //生命周期中的更新函数
      if(localStorage.getItem('shopCar')==null){
        this.$store.state.shopCar = [];
      }else{
        this.$store.state.shopCar = JSON.parse(localStorage.getItem('shopCar'));
      }
    }
}
</script>
<style lang="less">
  /* 引入iconfont字体 */
  @font-face {
    font-family: 'iconfont';
    src: url('../public/font_2207661_j89w8kmeka/iconfont.eot');
    src: url('../public/font_2207661_j89w8kmeka/iconfont.eot?#iefix') format('embedded-opentype'),
    url('../public/font_2207661_j89w8kmeka/iconfont.woff2') format('woff2'),
    url('../public/font_2207661_j89w8kmeka/iconfont.woff') format('woff'),
    url('../public/font_2207661_j89w8kmeka/iconfont.ttf') format('truetype'),
    url('../public/font_2207661_j89w8kmeka/iconfont.svg#iconfont') format('svg');
  }
  .iconfont {
    font-family: "iconfont" !important;
    font-size: 22px;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  *{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
#app .foot_mue{
  display: flex;
  height: 60px;
  /*width: 375px;*/
  /*margin: auto;*/
  /*border-left: 1px solid #ccc;*/
  /*border-right: 1px solid #ccc;*/
  position: fixed;  
  bottom: -2px;
  left: 0;
  right: 0;
  background: white;
  z-index: 100;
  border-top:1px solid #ccc;
}
#app .foot_mue a{
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #aaa;
  /*font-size:14px;*/
}
</style>

